﻿<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Inscription extends CI_Controller
{
    public function index()
    {
        $this->form_validation->set_rules('username', 'Username', 'callback_username_check');
		$this->form_validation->set_rules('password', 'Password', 'required');
		$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
		$this->form_validation->set_rules('email', 'Email', 'required|is_unique[users.email]');


		if ($this->form_validation->run() == FALSE)
		{
            $this->load->model('inscription_model');
            $groupes = $this->inscription_model->get_groupes();
			load_template('inscription', array('groupes' => $groupes));
		}
		else
		{
			load_template('accueil');
		}
    }
}
